//
// Created by 86176 on 2021/11/3.
//

#include "Session.h"

Session::Session() {
    ioBuffer = new IoBuffer();
    //packetLen = 0;
    socket = WSASocket(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED);
    //Olp.hEvent = WSACreateEvent();
    //lpFlags = 0;
    nReadSequence = nCurrentReadSequence;
}

Session::Session(int sessionId) {

}

void Session::buildFilterChain() {


}

Session::~Session() {
    closesocket(socket);
    delete(ioBuffer);
    if(NULL != idleStatus)
        delete(idleStatus);
//    printf("session destroy.\n");
}

IoBuffer *Session::getIoBuffer() const {
    return ioBuffer;
}

